<template>
  <div class="App2">
    <h1>自定义事件</h1>
    <!--
    子组件 => 父组件传值
      -->
    <hr>
    <h3></h3>
    <hr>
<!--    <ChildComponent @自定义事件="获取子组件传的数据"/>-->
    <ChildComponent
      @myEvent="receive"
      @my-person="receivePerson"
    />
  </div>
</template>

<script>
import ChildComponent from "@/components/ChildComponent";
export default {
  name: "App2",
  components: {
    ChildComponent,
  },
  methods: {
    receive(data) {
      console.log(data)
    },
    receivePerson(p) {
      console.log(p)
    }
  }
}
</script>

